<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="net.ojbk.jiaofu.service.*" import="net.ojbk.jiaofu.po.*" import="net.ojbk.jiaofu.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>任务页面</title>

<link href="css/bootstrap-jf.min.css" rel="stylesheet">
<link href="css/datepicker3-jf.css" rel="stylesheet">
<link href="css/styles-jf.css" rel="stylesheet">
<script type="text/javascript">
function copyurl()
{
var clipBoardContent="我给您推荐的网址: \r\n";
strHref = window.location.href;
//strUrl = strHref.split("?");
clipBoardContent += strHref;
if (window.clipboardData){
if(window.clipboardData.setData("Text",clipBoardContent)){
   alert('链接已复制');
}
}
else{
   alert('您使用的浏览器不支持此功能，请到地址栏复制链接');
}
}  
</script>
</head>

<%
// 基本信息
boolean isLogin = false;
String userId = "null";
String taskId = "";


// 对于业务页面不同而言
String[] basicInfoName = new String[0];
String[] basicInfo = new String[0];
String formatFileName = "null";
SyTask task = null;
if (session != null && session.getAttribute("login") != null && (boolean)session.getAttribute("login")) { // 登录
	userId = (String)session.getAttribute("myId");
	taskId = request.getParameter("taskId");
	isLogin = true;
	
	// 对于业务页面不同而言
	basicInfoName = StudentService.getBasicInfoName(taskId);
	basicInfo = StudentService.getBasicInfo(userId, taskId);
	task = TaskService.getTask(taskId);
	formatFileName = StringTool.formatFileName(task.getFileFormat(), basicInfoName, basicInfo, new String[0], new String[0]);
}

%>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="home.jsp"><span>师易</span>材料收集界面</a>
				<ul class="user-menu">
					<li class="dropdown pull-right">
						<a href="" class="dropdown-toggle" data-toggle="dropdown">个人主页</a>
					</li>
				</ul>
			</div>
							
		</div><!-- /.container-fluid -->
	</nav>
		
	<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
		<form role="search">
			<div class="form-group">
				<input type="text" class="form-control" placeholder="Search">
			</div>
		</form>
		<ul class="nav menu">
			<li><a href="#"><span class="glyphicon glyphicon-pencil"></span> 提交材料</a></li>	

			
            <li class="parent ">
                <a href="#">
                    <span class="glyphicon glyphicon-list"></span> 教务任务发布 <span data-toggle="collapse" href="#sub-item-1" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
                </a>
                <ul class="children collapse" id="sub-item-1">
                    <li>
                        <a href="publishImage.jsp">
                            <span class="glyphicon glyphicon-share-alt"></span> 截图任务发布
                        </a>
                    </li>
                    <li>
                        <a href="publishZip.jsp">
                            <span class="glyphicon glyphicon-share-alt"></span> 压缩包任务发布
                        </a>
                    </li>
                    <li>
                        <a href="publishExcel.jsp">
                            <span class="glyphicon glyphicon-share-alt"></span> 信息收集任务发布
                        </a>
                    </li>
                </ul>
            </li>

			<li><a href="home.jsp"><span class="glyphicon glyphicon-th"></span> 返回主页</a></li>
			<li role="presentation" class="divider"></li>
			<li><a href="#">登陆其他账号</a></li>
		</ul>
			<div class="attribution">提交提供 by <a href="#">师易</a></div>
	</div><!--/.sidebar-->
		
	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">			
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
				<li class="active">Task Zip</li>
			</ol>
		</div><!--/.row-->
		
		<div class="row">
			<div class="col-lg-12">
				<h1 class="page-header">Zip Task</h1>
			</div>
		</div><!--/.row-->
				
		
<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-heading">文件任务提交页面</div>
					<div class="panel-body">
						<div class="">
							<form role="form" action="collectServlet" method="post" enctype="multipart/form-data">
								<input type="hidden" name="taskId" value="<%= taskId %>">
								<div class="form-group" >
									<fieldset style="border:1px solid black;padding:5px 5px 10px;wrid">
										<label>需要获取的基本信息</label>
										<hr >
										<div class="form-row">
										<%
											for (int i=0; i<basicInfoName.length; i++) {
										%>
											<div class="field-label">
												<label for="field1"><%= basicInfoName[i] %></label>
												：<%= basicInfo[i] %>
											</div>
										<% } %>
										</div>
									</fieldset>   
								</div>
								
								<div class="form-group" >
									<fieldset style="border:1px solid black;padding:5px 5px 10px;wrid">
										<label>需要上交的文件</label>
										<hr >

										<div class="form-row">
											<div class="field-label"><label for="field3">You'r file</label>：<%= formatFileName %></div>
											<div class="field-widget"><input type="file" name="file"></div>
										</div>    
									</fieldset>   
								</div>
								<% 
								if (isLogin) {
								%> 
								<div  style="position: absolute; bottom: -70px; left: 40px;">

									<button type="submit" class="btn btn-primary">Submit Button</button>
									<button type="reset" class="btn btn-default">Reset Button</button>
									<td><a href="#none" onclick="copyurl()"><div id='portfolioline'>分享本页</div></a></td>
								</div>
 								<% } %> 
							</form>

						</div>
					</div>
				</div><!-- /.col-->
			</div><!-- /.row -->
		
	</div><!--/.main-->

	<script src="js/jquery-1.11.1.min-jf.js"></script>
	<script src="js/bootstrap.min-jf.js"></script>
	<script src="js/chart.min-jf.js"></script>
	<script src="js/chart-data-jf.js"></script>
	<script src="js/easypiechart-jf.js"></script>
	<script src="js/easypiechart-data-jf.js"></script>
	<script src="js/bootstrap-datepicker-jf.js"></script>
	<script>
		!function ($) {
			$(document).on("click","ul.nav li.parent > a > span.icon", function(){		  
				$(this).find('em:first').toggleClass("glyphicon-minus");	  
			}); 
			$(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
		}(window.jQuery);

		$(window).on('resize', function () {
		  if ($(window).width() > 768) $('#sidebar-collapse').collapse('show')
		})
		$(window).on('resize', function () {
		  if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide')
		})
	</script>	
</body>

</html>
